<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
        <script>
        if(window.localStorage){
            console.log(localStorage.haslogin);
            if(localStorage.haslogin==undefined||localStorage.haslogin==false){
                location.href="./login.html";
            }
        }else{
            alert("请打开浏览器cookie功能");
            location.href="./login.html";
        }
    </script>
    <title>个人信息</title>
    <link rel="icon" href="./images/logo.ico" />
    <script src="js/sethtmlfontSize.js"></script>
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="css/myself.css">
</head>
<body>
   <div id="header">
      <div class="head-div">
          <img class="header-img back-img" src="./images/myback.png" alt="">
          <span class="header-name">kewei</span>
          <img class="header-img home-img" src="./images/myhome.png" alt="">
      </div>
       <div class="header-pic">
           <img class="my-userImg" src="" alt="">    
       </div>
       
   </div>
   <div id="center">
       <div class="center-message">
           <div class="order zwl-center">
               <img class="order-icon" src="./images/myorder.png" alt="">
               <span>我的订单</span>
               <i></i>
           </div>
           <div class="collection zwl-center">
               <img class="order-icon" src="./images/mycollect.png" alt="">
                <span>我的收藏</span>
                <i></i>
           </div>
       </div>
   </div>
   <div id="footer" class="footer">
       <div class="footer-detail">
           <span class="loginOut detail">退出</span>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;城市：
           <span class="city detail"></span>
       </div>
       <div class="footer-ul">
           <ul>
               <li class="first"><a href="./index.html">首页</a></li>
               <li class="li login"><a href="javascript:void(0);">登录</a></li>
               <li class="li"><a href="http://www.shidiquan.cn">客户端</a></li>
               <li class="li"><a href="javascript:void(0);">电脑版</a></li>
               <li class="li"><a href="http://www.shidiquan.cn">帮助</a></li>
           </ul>
       </div>
   </div>
   
   <!--退出提示框-->
   <div class="loginOutUI">
        <p class="promitInfo">退出当前账号</p>
        <p class="chooseBtn"><span class="outSure">确定</span><span class="outCancel">取消</span></p>
   </div>
   
</body>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="./js/pub_page.js"></script>
<script>
    //set当前城市
    var currentCity=SYS_GLOBAL_CONFIG.getCurrentCity("currentCIty");
    if(window.localStorage){
        $(".city").html(localStorage.currentCity);
    }else{
        $(".city").html(currentCity);
    }

    $(".header-img").on("click",function(){
        history.back(-1);
    });
    //回到主页
    $(".home-img").on("click",function(){
        location.href="./index.html";
    });
    //退出登录
    $(".loginOut").on("click",function(){
        $(".loginOutUI").css("display","block");
        
    });
    //进入选择城市页面
    $(".footer-detail .city").on("click",function(){
        location.href="./chooseCity.html";
    });
    /**
     *确定退出登录,清除登录信息，设置登录状态
     **/
    $(".outSure").on("click",function(){
        $(".loginOutUI").fadeOut(100);
        if(window.localStorage){
            localStorage.userName="";
            localStorage.userId="";
            localStorage.userImg="";
            localStorage.haslogin="";
        }else{
            
        }
        location.href="./login.html";
    });
    //取消退出登录
    $(".outCancel").on("click",function(){
        $(".loginOutUI").fadeOut(100);
    });
    var userId;
    var userName;
    var userImg;
    //获取url参数值
    if(window.localStorage){
        userId=window.localStorage.userId;
        userName=localStorage.userName;
        userImg=localStorage.userImg;
        $(".header-name").html(userName);
        $(".header-pic img").attr("src",userImg);   
    }else{
        alert("请打开本地cookie功能");
        userId=SYS_GLOBAL_CONFIG.getQueryString("userId");
    }

    $(".my-userImg").on("click",function(){
        location.href="./index.html";
    });
    
    $(".collection").on("click",function(){
        location.href="./myCollect.html?userId="+userId;
    });
</script>
</html>